package com.dzm.xgb.oss.properties;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 作者：Dzm
 * 时间：2024-08-20-14:45
 * 功能：
 */

@Configuration
@ConfigurationProperties(prefix = "aliyun.oss")
@Data
public class OssProperties implements InitializingBean {
    private String endpoint;
    private String accessKey;
    private String accessSecret;
    private String bucketName;

    public static String ENDPOINT;
    public static String ACCESS_KEY;
    public static String ACCESS_SECRET;
    public static String BUCKET_NAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT = this.endpoint;
        ACCESS_KEY = this.accessKey;
        ACCESS_SECRET = this.accessSecret;
        BUCKET_NAME = this.bucketName;
    }
}


